package company.controller;

import company.common.R;
import company.domain.Adopt;
import company.domain.Forumposts;
import company.service.AdoptService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class AdoptController {
    @Resource
    AdoptService adoptService;

    /*
     * 新增领养
     * */
    @PostMapping("/Addadopt")
    public R AddAdopt(@RequestBody Adopt adopt){
        boolean save = this.adoptService.save(adopt);
        if (save){
            new R().setCode(502);
        }
        return new R();
    }
}
